package com.lhh.mapper;

import com.lhh.entity.Validate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ValidateMapper {
    //在validate表中添加账号等信息
    @Insert("insert into validate (userName,passwd,status,gmtCreate,gmtModified,token) values (#{userName},#{passwd},#{status},#{gmtCreate},#{gmtModified},#{token})")
    int insert(Validate validate);

    //根据token查询用户
    @Select("select * from validate where token = #{token}")
    Validate selectByToken(String token);

    @Select("select * from validate where email = #{email}")
    List selectByEmail(String email);
}
